- var currentPage = false
- var nextPage = false
- var hideNextPage = false;

- var data = public.docs[current.path[1]][current.path[2]][current.path[3]]._data

for page, slug in data

  // CHECK IF CURRENT PAGE IS SET, THEN SET NEXT PAGE
  if currentPage
    if !nextPage && page.nextable && !page.hide
      if !hideNextPage
        .l-sub-section
          h3 下一步
          a.translated-cn(href="/docs/#{current.path[1]}/#{current.path[2]}/#{current.path[3]}/#{slug}.html") #{page.title}

      //NEXT PAGE HAS NOW BEEN SET
      - var nextPage = true

  - hideNextPage = page.hideNextPage

  // SET CURRENT PAGE FLAG WHEN YOU PASS IT
  if current.path[4] == slug
    - var currentPage = true
